package com.ruoyi.generator.exception;

import com.ruoyi.common.enums.StatusCodeEnum;

import lombok.AllArgsConstructor;
import lombok.Getter;

import static com.ruoyi.common.enums.StatusCodeEnum.FAIL;

@Getter
@AllArgsConstructor
public class BizException extends RuntimeException{
    
    private Integer code = FAIL.getCode();
    
    private final String message;
    
    public BizException(String message){
        this.message = message;
    }
    
    public BizException(StatusCodeEnum statusCodeEnum){
        this.code = statusCodeEnum.getCode();
        this.message = statusCodeEnum.getDesc();
    }
    
}
